package com.dz.risk.config;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;

/**
 * @author 常用报文信息
 * @className MsgConfig
 * @description TODO
 * @date 2021/2/18 14:52
 */
@Configuration
@Component
@Data
public class MsgConfig {

    @Value("${spring.datasource.url}")
    private String mysqlUrl;

    @Value("${spring.datasource.driver-class-name}")
    private String mysqlDriverName;

    @Value("${spring.datasource.username}")
    private String mysqlUsername;

    @Value("${spring.datasource.password}")
    private String mysqlPassword;

    @Value("${druid.loginUsername}")
    private String loginUsername;

    @Value("${druid.loginPassword}")
    private String loginPassword;

    @Value("${caffrine.maximumSize}")
    private Integer maximumSize;

    @Value("${caffrine.initialCapacity}")
    private Integer initialCapacity;

    @Value("${caffrine.timeout}")
    private Integer timeout;

    @Value("${caffrine.hourOut}")
    private Integer hourOut;


    /**
     * 获取所有单元格关联表名
     * @return
     */
    public String getTableName(String tableName) {
        Map<String, String> map = new HashMap();
        map.put("t_st_risk_factor", "t_st_risk_factor");
        map.put("t_st_risk_factor_value", "t_st_risk_factor_value");
        return map.get(tableName);
    }
}
